package com.ilas.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 租户(SysTenant)实体类
 *
 * @author luzck
 * @since 2021-04-13 15:37:46
 */
@Data
@ApiModel(value = "SysTenant", description = "租户")
public class SysTenant implements Serializable {
    private static final long serialVersionUID = -35142937477811308L;

    @ApiModelProperty(name = "id", dataType = "Long", value = "主键ID")
    private Long id;

    @NotNull
    @ApiModelProperty("租户编号，添加后不允许修改")
    private String code;

    @NotNull
    @ApiModelProperty("租户名称")
    private String name;

    @NotNull
    @ApiModelProperty("租户前端使用域名，注册用户登录时用来判断所属租户信息")
    private String domainName;

    @ApiModelProperty("数据库类型，默认MySQL")
    private String datasourceType;

    @ApiModelProperty(value = "数据库url，添加后不允许修改", hidden = true)
    private String datasourceUrl;

    @NotNull
    @ApiModelProperty("数据库ip")
    private String datasourceIp;

    @NotNull
    @ApiModelProperty("数据库端口号")
    private String datasourcePort;

    @ApiModelProperty("数据库用户名")
    private String datasourceUsername;

    @ApiModelProperty("数据库密码")
    private String datasourcePassword;

    @ApiModelProperty("数据库驱动,默认为mysql驱动")
    private String datasourceDriver;

    /**
     * 有效期，单位：天
     */
    @NotNull
    @ApiModelProperty("有效期，单位：天")
    private Integer usageDays;

    @ApiModelProperty(value = "租户过期时间", hidden = true)
    private Date expiryDate;

    @ApiModelProperty(value = "菜单模板id", hidden = true)
    private Long templateId;

    /*@ApiModelProperty("租户联系方式")
    private String contact;

    @ApiModelProperty("所在省")
    private String province;

    @ApiModelProperty("所在市")
    private String city;

    @ApiModelProperty("所在区")
    private String district;

    @ApiModelProperty("具体地址")
    private String address;*/

    @ApiModelProperty("租户状态，1-正常，2-停用")
    private String status;

    @ApiModelProperty("创建者")
    private String creator;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("创建时间")
    private Date createTime;

}